<?php
require_once('libs/MySmarty.php');
require_once('libs/DbAccess.php');
require_once('classes/entry_edit.class.php');

$formPage = new entry_edit();

$_action = isset($_REQUEST['action']) ? $_REQUEST['action'] : 'view';

switch($_action) {
	case 'update':
		$formPage->doUpdate($_REQUEST);
        $formPage->displayForm($_REQUEST);   
        break;
	case 'updateTag':
		$formPage->updateTag($_REQUEST);
        $formPage->displayForm($_REQUEST);   
        break;
    case 'delTag':
		$formPage->delTag($_REQUEST);
        $formPage->displayForm($_REQUEST);   
        break;
	case 'insertTag':
		$formPage->insertTag($_REQUEST);
        $formPage->displayForm($_REQUEST);   
        break;
	case 'insert':
		$formPage->doUpdate($_REQUEST);
        $formPage->displayForm($_REQUEST);   
        break;
    case 'view':
    default:
        // viewing the guestbook
        $formPage->displayForm($_REQUEST);   
        break;   
}
?>